import axios from 'axios'

const API_URL = "http://localhost:8080/app/room-inventory"

export const getRoomCount=(hotelId,checkIn,checkOut)=>{
    return axios.get(`${API_URL}/roomCount`,{params: {
    hotelId: hotelId,
    checkIn: checkIn,
    checkOut: checkOut
  }})
}

// export const decrRoomCount=(hotelId,roomTypeId,checkIn,checkOut)=>{
//     return axios.post(`${API_URL}/decrCount`,{params: {
//     hotelId: hotelId,
//     roomTypeId:roomTypeId,
//     checkIn: checkIn,
//     checkOut: checkOut
//   }})
// }

export const decrRoomCount = (hotelId, roomTypeId, checkIn, checkOut) => {
  return axios.post(`${API_URL}/decrCount`, null, {
    params: {
      hotelId,
      roomTypeId,
      checkIn,
      checkOut
    }
  })
}

export const getRoomTypeRoomCount = (hotelId, roomTypeId, checkOut) => {
  return axios.get(`${API_URL}/delay`,{params:{
    hotelId:hotelId,
    roomTypeId:roomTypeId,
    checkOut:checkOut
  }})
}

